#ifndef ConfigEditor_H
#define ConfigEditor_H

#include <QWidget>
#include <QVector>
#include "UpdateOption.h"
#include "global.h"

class ConfigItem;
class SwitchButton;
class QScrollArea;
class QPushButton;
class QLineEdit;
class QLabel;
class ConfigSearchBar;


class ConfigEditor : public QWidget
{
    Q_OBJECT

public:

    ConfigEditor(QWidget *parent = nullptr);
    ~ConfigEditor() override;

protected:
    void paintEvent(QPaintEvent *event) override;
    void closeEvent(QCloseEvent *event) override;

private slots:
    //void onItemEdited();
    void onResetButtonClicked();
    void onSwitchButtonIndexChanged(int index);


private:
    SwitchButton *switchButton;
    QPushButton *resetButton;
    ConfigSearchBar* searchBar;
    QScrollArea *scrollWidget;
    QVector<QWidget*> subWidgets;


signals:
    void aboutToClose();
};
#endif // WIDGET_H
